"Selected Columns:
The sql expression that I used in the above example uses "SELECT * FROM STARTERHISTORY" (without the quotes.)
Using the * or wildcard character in this manner causes the .CSV file generated by an export to include every column in the table.
When you want the .CSV file generated by an export to contain every column in the table:
Use the * or wildcard character like I did in the above example.
But when you want the .CSV file generated by an export to only contain selected columns:
Change your sql expression. Reference only the column names you want in the .CSV file created by the Export.
For example, if the following sql expression were used to generate an export:
"SELECT [DATE], TRACK, RACE, HORSENAME, ODDS FROM STARTERHISTORY" (without the quotes.)
The resulting .CSV file generated by the export will contain only the following selected columns:
DATE, TRACK, RACE, HORSENAME, and ODDS.
What if you want to make the columns in the .CSV file created by an Export appear in a specific order? For example:
ODDS, HORSENAME, DATE, TRACK, RACE
Simply change the order in which the column names are referenced in your sql expression - like this:
"SELECT ODDS, HORSENAME, [DATE], TRACK, RACE FROM STARTERHISTORY" (without the quotes.)
Selected Rows:
In the above sql expression, I used the following WHERE clause:
WHERE track='aqu'
and intsurface = 2
and dist = 1320
and not startslifetime = 0
and [DATE] >= #01-01-2015#
and [DATE] <= #12-31-2015#
The factor constraints after the WHERE keyword, in this case track, intsurface, dist, startslifetime, and [DATE], control the rows that are written to the .CSV file by the Export.
Change the expression text after the WHERE keyword to change the rows that appear in a .CSV file created by an Export.
Row Sorting:
In the above sql expression, I used the following ORDER BY clause:
ORDER BY [DATE], val(RACE)
The field names after the ORDER BY keyword, in this case [DATE], val(RACE), control the order in which the rows within a .CSV file created by an Export are sorted.
Change the expression text after the ORDER BY keyword to change the sort order for the rows within a .CSV file created by an Export.
These behaviors apply to all Exports generated by the JCX File Exports Module."